package com.piotrs10.bsk.gui.views;

import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;

public abstract class ModifyLayout extends VerticalLayout implements
		ClickListener {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2451695350453911003L;

	protected Button commitButton;
	protected Panel fieldsPanel;
	protected Window modalWindow;

	protected ModifyLayout(boolean isInsert, Window modalWindow) {
		this.setSpacing(true);
		this.fieldsPanel = new Panel();
		this.modalWindow = modalWindow;
		
		VerticalLayout fieldsLayout = new VerticalLayout();
		fieldsLayout.setSpacing(true);
		fieldsLayout.setMargin(true);
		this.fieldsPanel.setContent(fieldsLayout);
		this.commitButton = new Button("Zapisz");
		this.addComponent(this.fieldsPanel);
		this.commitButton.addListener(this);
	}

	@Override
	public abstract void buttonClick(ClickEvent event);

	public abstract String getWinWidth();

	public abstract String getWinHeight();

}
